Skip to content

util: stop using uninitialized memory - #415

Draft
brongan wants to merge 1 commit into
virtee:mainfrom
brongan:fix-uninit-assume-init
Draft

brongan wants to merge 1 commit into
virtee:mainfrom
brongan:fix-uninit-assume-init

Conversation

@brongan

@brongan brongan commented Nov 11, 2026 •

Copy link
Copy Markdown

Initialize memory with zeroes before reading data into it. Read raw bytes only into types that accept every bit pattern.

The crate constructed values from uninitialized memory. This causes undefined behavior.

@brongan
brongan force-pushed the fix-uninit-assume-init branch 4 times, most recently from 6656aca to 5553d1a Compare November 12, 2026 19:30
@brongan brongan changed the title util: stop calling assume_init on uninitialized memory util: stop using uninitialized memory Nov 12, 2026
@brongan
brongan force-pushed the fix-uninit-assume-init branch from 5553d1a to 945b8c1 Compare November 12, 2026 19:37
Initialize memory with zeroes before reading data into it. Read raw
bytes only into types that accept every bit pattern.

The crate constructed values from uninitialized memory. This causes
undefined behavior.

Signed-off-by: Brennan Tracy <[email protected]>
@brongan
brongan force-pushed the fix-uninit-assume-init branch from 945b8c1 to f149d75 Compare November 13, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant